<?php

namespace Sifast\ProjectBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;

class CoordonneesPersonnellesAdmin extends Admin
{
 
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->with('L1')
            ->add('telephoneDomicile','text',array(
                'label'=>'Téléphone domicile:'
            ))
            ->add('mobile1Perso','text',array(
                'label'=>'Mobile personnel 1:'
            ))
            ->end()
            ->with('L2')    
            ->add('mobile2Perso','text',array(
                'label'=>'Mobile personnel 2:'
            ))
            ->add('mobile3Perso','text',array(
                'label'=>'Mobile personnel 3:'
            ))
            ->end()
            ->with('L3')    
            ->add('telephoneTravail','text',array(
                'label'=>'Téléphone travail:'
            ))
            ->add('mobile1Pro','text',array(
                'label'=>'Mobile travail 1:'
            ))
            ->end()
            ->With('L4')    
            ->add('mobile2Pro','text',array(
                'label'=>'Mobile travail 2:'
            ))
            ->add('mobile3Pro','text',array(
                'label'=>'Mobile travail 3:'
            ))
            ->end()
            ->with('L5')    
            ->add('emailPro','text',array(
                'label'=>'Email professionnel:'
            ))
            ->add('emailPerso','text',array(
                'label'=>'Email personnel:'
            ))
            ->end()
            ->with('L6')    
            ->add('dateDebut', 'date', array(
                    'label'=> 'Date de debut:',
                    'widget' => 'single_text',
                    'format' => 'MM/dd/yyyy',
                    'attr' => array('class' => 'datepicker')
                ))
            ->add('dateFin', 'date', array(
                    'label'=> 'Date de fin:',
                    'widget' => 'single_text',
                    'format' => 'MM/dd/yyyy',
                    'attr' => array('class' => 'datepicker')
                ))
            ->end();
            
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
           ->add('telephoneDomicile')
            ->add('mobile1Perso')
            ->add('mobile2Perso')
            ->add('mobile3Perso') 
            ->add('telephoneTravail')
            ->add('mobile1Pro')
            ->add('mobile2Pro')
            ->add('mobile3Pro')
            ->add('emailPro')
            ->add('emailPerso')
            ->add('dateDebut')
            ->add('dateFin');
            
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('telephoneDomicile')
            ->add('mobile1Perso')
            ->add('mobile2Perso')
            ->add('mobile3Perso') 
            ->add('telephoneTravail')
            ->add('mobile1Pro')
            ->add('mobile2Pro')
            ->add('mobile3Pro')
            ->add('emailPro')
            ->add('emailPerso')
            ->add('dateDebut')
            ->add('dateFin');
            
            }
}